package com.smarthome.api.mobile.service;

import com.smarthome.domain.mobile.MobileRequest;
import com.smarthome.domain.mobile.MobileResponse;
import com.smarthome.common.mobile.Service;
import com.smarthome.domain.mobile.res.MobileHaiKangTokenGetResponse;
import com.smarthome.common.tools.BossCachedKeysUtil;
import com.smarthome.common.tools.cache.JedisUtils;

/**
 * 获取海康视频token命令。
 * 
 * 
 * @author KongXiangyu
 * 
 * @since 1.0
 */
@org.springframework.stereotype.Service("mobile.haikangVideo.token.get")
public class MobileHaiKangTokenGetService implements Service<MobileResponse<MobileHaiKangTokenGetResponse>> {

    public void execute(MobileRequest request, MobileResponse<MobileHaiKangTokenGetResponse> response) {
        MobileHaiKangTokenGetResponse tokenGet = new MobileHaiKangTokenGetResponse();
        tokenGet.setToken((String) JedisUtils.get(BossCachedKeysUtil.getKey(BossCachedKeysUtil.MODULE_HK_VIDEO_TOKEN, "1")));
        response.setData(tokenGet);
    }

}
